//
//  SendLogicHandle.h
//  NLProjectFrameworkDemo
//
//  Created by iosdeveloper on 2020/4/28.
//  Copyright © 2020 yj_zhang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SendComLogicHandle.h"

static NSTimeInterval preReadTimer=200;
NS_ASSUME_NONNULL_BEGIN


/**
 *  一般操作成功回调
 */
typedef void (^MartinImSucc)(void);

/**
 *  操作失败回调
 *
 *  @param code 错误码
 *  @param msg  错误描述，配合错误码使用，如果问题建议打印信息定位
 */
typedef void (^MartinsImFail)(int code, NSString * msg);


@interface SendLogicHandle : NSObject
@property(nonatomic,strong,nullable)WelcomeJsonData*buildModel;//建立连接模型
@property(nonatomic,strong,nullable)MatinsIMinitModel*myModel;//初始化模型


+(SendLogicHandle*)keySendLoginHandle;


//仅仅给后台发送消息
-(void)sendChatMesage:(TIMMessage*)msg sucess:(MartinImSucc)sucessBlock fail:(MartinsImFail)failBlock;

//发送预读消息业务逻辑
-(void)sendPreReadNewssucess:(MartinImSucc)sucessBlock fail:(MartinsImFail)failBlock inputStr:(NSString*)inputStr;
//发送离线消息业务逻辑
-(void)sendOFFLINENewssucess:(MartinImSucc)sucessBlock fail:(MartinsImFail)failBlock;
//接收到转接发送
-(void)sendTransMesagesucess:(MartinImSucc)sucessBlock fail:(MartinsImFail)failBlock;
//咨询师离线
-(void)sendConsultLeaveMesagesucess:(MartinImSucc)sucessBlock fail:(MartinsImFail)failBlock;
//发送欢迎语消息
-(void)sendWelcomTextMesagesucess:(MartinImSucc)sucessBlock fail:(MartinsImFail)failBlock;


-(void)sendDifferentMessaeWith:(NSString*)sendType chatModel:(WelcomeJsonData*)chatModel myModel:(MatinsIMinitModel*)myModel contentType:(NSString*)contentType msg:(NSString*)msg sucess:(MartinImSucc)sucessBlock fail:(MartinsImFail)failBlock;
-(void)clearAllLogic;
@end

NS_ASSUME_NONNULL_END
